import React from 'react'
import {connect} from 'dva'
import Example from '../../components/Example'
// 路由跳转(第一种)
import {Link} from 'dva/router' 


class indexRouter extends React.Component {
  render() {
    const { productList ,dispatch ,history } = this.props;
    return (
      <div>
        <Example dispatch={dispatch} title="向子组件传值" productList = {productList}/>
        <Link to="/">去首页</Link>
      </div>
    )
  }
}

const mapStateToProps = (state) => {
  return {
    productList:state.product
  }
}

export default connect(mapStateToProps)(indexRouter)
